package com.Test;

import com.javabean.Role;
import com.javabean.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class JTest {
    @Test
    public void J1() {
        ApplicationContext applicationContext = new
                ClassPathXmlApplicationContext("applicationContext.xml");
        User user = (User) applicationContext.getBean("j1");
        System.out.println(user);
    }
    @Test
    public void J2() {
        ApplicationContext applicationContext = new
                ClassPathXmlApplicationContext("applicationContext.xml");
        User user = (User) applicationContext.getBean("j2");
        System.out.println(user);
    }
    @Test
    public void J3() {
        ApplicationContext applicationContext = new
                ClassPathXmlApplicationContext("applicationContext.xml");
        Role role = (Role) applicationContext.getBean("j3");
        System.out.println(role);
    }
}
